<?php use_helper('PA_Links') ?>
<div class="sComponentContainer">
  <div class="sComponent floatLeft">
    <p id="title">Kontrahenci</p>
    <table id="deliverersTable">
      <tr>
        <th>Nazwa</th>
        <th>Osoba</th>
        <th>Telefon</th>
        <th>Email</th>
        <th>Adres</th>
        <th>Kategorie</th>
        <th>Skrót</th>
        <th>Edycja</th>
      </tr>
    <?php if(isset($deliverers)): ?>
        <?php foreach($deliverers as $deliverer): ?>
        <tr>
          <td nowrap="nowrap"><?php echo $deliverer->getName() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getPerson() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getTelephone() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getEmail() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getAddress() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getDelivererCategoriesNames() ?></td>
          <td nowrap="nowrap"><?php echo $deliverer->getShortcut() ?></td>
          <td nowrap="nowrap">
            <img src="/images/icons/change.png" class="middle" width="18" height="18"/>  <a onclick="App.Table.attachForm(this, '<?php echo link_to_app('Core', 'homeGetForm', array('form' => 'DelivererForm', 'form_action' => 'update', 'id' => $deliverer->getId())) ?>', '#deliverersTable', 'updateDeliverer', 6, 7, true)" class="middle">Zmień</a>
            <img src="/images/icons/delete.png" class="middle" width="18" height="18"/>  <a href="<?php echo link_to_app('Production', 'deleteDeliverer', array('id' => $deliverer->getId())) ?>" class="middle">Usuń</a>
          </td>
        </tr>
        <?php endforeach; ?>
    <?php endif; ?>
      <tr id="add">
        <td colspan="8"><img src="/images/icons/add.png" class="middle" width="18" height="18"/>  <a onclick="App.Table.attachForm(this, '<?php echo link_to_app('Core', 'homeGetForm', array('form' => 'DelivererForm', 'form_action' => 'create')) ?>', '#deliverersTable', 'createDeliverer', 6, 7)" class="middle">Dodaj</a></td>
      </tr>
    </table>
  </div>
</div>